package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);unique;not null;comment:用户名不正确"`
	Password string `gorm:"type:varchar(20);not null;comment;密码"`
	Salt     string `gorm:"type:varchar(20);not null;comment:盐值"`
	Mobile   string `gorm:"type:char(11);unique;comment:电话"`
}
type UserRealName struct {
	gorm.Model
	UserID   int64  `gorm:"unique;not null;comment:用户id"`
	RealName string `gorm:"type:varchar(20);not null;comment:名字"`
	IdCard   string `gorm:"type:varchar(20);not null;comment:身份证号"`
}

// 创建实名信息
func (u *UserRealName) Create() error {
	return DB.Create(u).Error
}
